Think well of your Lord, and be certain - not tainted by any doubt - that God is the most merciful!
Let us first define the word “affliction”. It does not mean calamities only, but rather means everything that is difficult for a person to accept, do, or refrain from.
The calamity is difficult for a person to accept, and most of the commands and prohibitions are difficult for a person to comply with. This is the comprehensive picture of affliction, and not merely the infliction of calamities on man.
Allah swt says: “Be sure we shall test you with something of fear and hunger, some loss in goods or lives or the fruits (of your toil), but give glad tidings to those who patiently persevere.” Surah Al Baqarah
The answer to the maddening question is actually simple, Allah tests us because He is merciful to us; It is out of His mercy, Glory be to Him, to His servants that He afflicts them. lest they find peace or be at ease with the Dunya, so He led them to that bliss with the hardships of trials and costs; He forbade them to give them, He tested them to heal them, and He killed them to give them life.
Even the infidel, Allah afflicts him in order to turn to Him, Glory be to Him; Perhaps his heart encounters a moment of sorrow, so he repents and returns to his Lord.
Duaa for our oppressed brothers
O Allah, protect our brothers. Guard them from In front of them and behind them, from their right, and from their left, and from above them.
We seek protection in your Greatness from being unexpectedly destroyed from beneath them. O Allah, make them in Your protection, and send Your mercy down on them, and watch over them with Your eyes that never sleep.